home *** CD-ROM | disk | FTP | other *** search
- on enterFrame
- global gUniversoPicts
- put the number of member "Universo Picts" into gUniversoPicts
- repeat with i = 1 to 12
- puppetSprite i,true
- end repeat
-
-
- global gUniversoPosicaoX,gUniversoPosicaoY
- put 0 into gUniversoPosicaoX
- put 0 into gUniversoPosicaoY
- moveUniverso gUniversoPosicaoX,gUniversoPosicaoY
-
- repeat with i=1 to 12
- set the foreColor of sprite i to ¬
- (the backColor of member "FundoPreto")
- set the backColor of sprite i to ¬
- (the backColor of member "FundoBranco")
- set the visible of sprite i to true
- end repeat
- updateStage
-
- end
-
- on idle
- -- gPals, gArqs e gRefs sao referencias ao
- -- banco de dados de palavras, arquivos e referencias
- global gEntrada, gPals, gArqs, gRefs
- global gPalIndexes, gArqIndexes, gPalSelect
- global gBuscando, gTamanhoLista
-
- -- Testa se a pessoa digitou alguma coisa no campo
- -- "Busca"
- if (gEntrada <> the text of field "Busca") then
-
- -- Limpa listas
- set the text of field "Lista Palavras" to ""
- set the text of field "Lista Arquivos" to ""
- put psGeraTitulos(1,20) into lista
- set the text of member "Paginas Selecionadas" to lista
- put "" into lista
- put [] into gPalIndexes
- put [] into gArqIndexes
- put -1 into gPalSelect
- put false into gBuscando
- put 0 into gTamanhoLista
-
-
- -- Guarda o que a pessoa digitou
- put the text of field "Busca" into gEntrada
-
- -- Se a pessoa nao digitou nada, volta com as
- -- listas vazias
- if (gEntrada = "") then return
-
- -- Prepara busca na base de dados
- mSetCriteria(gPals, "canonica", "starts", canoniza(gEntrada))
- mSelect(gPals)
-
- -- Se ha' mais que 20 registros para ler, prepara
- -- para continuar a ler nos proximos "idle"
- put mSelectCount(gPals) into counter
- if counter > 20 then
- put 20 into counter
- put true into gBuscando
- end if
-
- -- Le ate' os primeiros 20 da lista
- repeat while counter > 0
- if (lista <> "") then put RETURN after lista
- put mGetField(gPals,"palavra") after lista
- add gPalIndexes, mGetField(gPals,"palNum")
- mGoNext(gPals)
- put counter - 1 into counter
- put gTamanhoLista + 1 into gTamanhoLista
- end repeat
-
- -- Reseta lista de palavras
- set the text of field "Lista Palavras" to lista
- set the foreColor of field "Lista Palavras" to ¬
- (the backColor of member "FundoPreto")
-
- -- Atualiza "Stage"
- updateStage
-
- -- Se continua o mesmo inicio de palavra em "Busca"
- -- Verifica se ha' mais registros para ler
- else if gBuscando then
-
- -- Verifica tamanho da memoria
- global myMemSize
- if myMemSize <= 8192*1024 or ¬
- (myMemSize <= 16384*1024 and gTamanhoLista > 100) then
- put false into gBuscando
- return
- end if
-
-
- -- Le 3 registros de cada vez
- put 3 into counter
- put 0 into ret
-
- -- Le 3 registros ou ate chegar no fim
- put the text of field "Lista Palavras" into lista
- repeat while counter > 0 and ret >= 0
- put RETURN & mGetField(gPals,"palavra") after lista
- add gPalIndexes, mGetField(gPals,"palNum")
- set ret to mGoNext(gPals)
- put counter - 1 into counter
- put 1 + gTamanhoLista into gTamanhoLista
- end repeat
- set the text of field "Lista Palavras" to lista
-
- if ret < 0 then put false into gBuscando
- end if
- end